
var vm = new Vue({
    el: '#rrapp',
    data: {
        showList: true,
        title: null,
       moduleError : {
            updateTime: '',
            updateUser: '',
            createTime: '',
            createUser: '',
            delFlag: 1,
            errorCheckTime: '',
            errorDisStatus: 0,
            errorReviewUser: '',
            maintainRecord: '',
            productType: '',
            productSeries: '',
            moduleType: '',
            dealOpinion: '',
            dealSuggest: '',
            description: '',
            productLine: '',
            workshop: '',
            maintainTime: new Date(),
            isReplaceSparepart: 1,
            isOff: 0,
            moduleCode: '',
            id: '',
        },
        ruleValidate: {
            moduleCode: [
                {required: true, message: '模具编码不能为空', trigger: 'blur'}
            ]
        },
        q: {
            moduleCode: ''
        }
    },
    methods: {
        query: function () {
            vm.reload();
        },
        add: function () {
            vm.showList = false;
            vm.title = "新增";
            vm.moduleError = {
                updateTime: '',
                updateUser: '',
                createTime: '',
                createUser: '',
                delFlag: 1,
                errorCheckTime: '',
                errorDisStatus: 0,
                errorReviewUser: '',
                maintainRecord: '',
                productType: '',
                productSeries: '',
                moduleType: '',
                dealOpinion: '',
                dealSuggest: '',
                description: '',
                productLine: '',
                workshop: '',
                maintainTime: new Date(),
                isReplaceSparepart: 1,
                isOff: 0,
                moduleCode: '',
                id: '',
            };
        },
        update: function (event) {
            var id = getSelectedRow("#jqGrid");
            if (id == null) {
                return;
            }
            vm.showList = false;
            vm.title = "修改";

            vm.getInfo(id);
        },
        saveOrUpdate: function (event) {
            var url = vm.moduleError.id == (null || '') ? "../moduleerror/save" : "../moduleerror/update";
            Ajax.request({
                url: url,
                params: JSON.stringify(vm.moduleError),
                type: "POST",
                contentType: "application/json",
                successCallback: function (r) {
                    alert('操作成功', function (index) {
                        vm.reload();
                    });
                }
            });
        }
    }
});

getFormDates=function () {

    return  vm.moduleError;
}